package com.wgu.crawl2.service.impl;

import com.wgu.crawl2.repo.XBQGBookRepository;
import com.wgu.crawl2.service.XBQGBookService;
import com.wgu.xbqg.XBQGBook;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.transaction.Transactional;
import java.util.List;

/**
 * Created by w on 2019/6/27.
 */
@Service
public class XBQGBookServiceImpl implements XBQGBookService {
    @Resource
    private XBQGBookRepository xbqgBookRepository;

    @Override
    @Transactional
    public XBQGBook save(XBQGBook xbqgBook) {
        return xbqgBookRepository.save(xbqgBook);
    }

    @Override
    public List<XBQGBook> list(Pageable pageable) {
        return xbqgBookRepository.findAll(pageable).getContent();
    }
}
